class FactoryLog extends eui.Component{
	constructor(){
		super();
		this.skinName="skins.scene.FactoryLogSkin";
	}
	private onClose(evt:egret.TouchEvent){
		DisplayController.instance().removeFromAlert(GameConst.GrayMask);
		DisplayController.instance().removeFromAlert(this);
	}

	public onLogsBack(list){
		// this.message_area.textFlow = GuildMgr.getInstance().parseLogs(list);
		// if( this.message_area.textFlow.length == 0){
		// 	this.message_area.textFlow = [
		// 		{
		// 			text:"当前无操作日志",
		// 			style:{
		// 				"textColor": 0x915a07,
		// 				"size":16,
		// 			}
		// 		}

		// 	];;
		// }
	}

	public show(){
		if( !DisplayController.instance().stage) return;
		DisplayController.instance().addToAlert(GameConst.GrayMask);
		DisplayController.instance().addToAlert(this);
		window["__factoryLog"]();
	}
	public measure() {
		super.measure();
		this.x = GameConst.StageW - this.measuredWidth >> 1;
		this.y = GameConst.StageH - this.measuredHeight >> 1;
	}
	public img_close:eui.Image;
	public scroller:eui.Scroller;
	public messageGroup:eui.Group;
	public message_area:eui.Label;
	public partAdded(name:string, instance:any){
		super.partAdded(name, instance);
		if(name == "img_close"){
			this.img_close=instance;
			this.img_close.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClose, this);
		}else if(name == "scroller"){
			this.scroller=instance;
		}else if(name == "messageGroup"){
			this.messageGroup=instance;
		}else if(name == "message_area"){
			this.message_area=instance;
		}
	}

	private static _instance:FactoryLog;
	public static getInstance():FactoryLog{
		if(FactoryLog._instance == null){
			FactoryLog._instance = new FactoryLog();
		}
		return FactoryLog._instance;
	}
}